home *** CD-ROM | disk | FTP | other *** search
- #include "ODBCSharedLibraries.h"
-
- #if PPCODBC
-
- #include <Memory.h>
- #include <Errors.h>
-
- Handle hinst;
-
- // _____________________________________________________________________________
- OSErr
- SampleDriverInit( InitBlockPtr ib )
- {
- /*
- * shared library init function. All shared libraries should have one. Its name is
- * declared in the .exp file.
- */
-
- if ( ib->fragLocator.where != kOnDiskFlat ) { return -32323; }
-
- hinst = NewHandle( sizeof( ODBCLibConnection ) );
- if ( ! hinst ) { return memFullErr; }
- HLock( hinst );
-
- (*(ODBCLibConnection**)hinst)->spec = *ib->fragLocator.u.onDisk.fileSpec;
- (*(ODBCLibConnection**)hinst)->connId = ib->connectionID;
-
- HUnlock( hinst );
-
- return noErr;
- }
-
-
- // _____________________________________________________________________________
- void
- SampleDriverMain( ODBCLibConnectionHandle inst2init )
- {
- HLock( hinst );
- HLock( (Handle)inst2init );
- **inst2init = **(ODBCLibConnection**)hinst;
- HUnlock( (Handle)inst2init );
- HUnlock( hinst );
- }
-
-
- #else // PPCODBC
-
- // _____________________________________________________________________________
- void
- SampleDriverInit()
- {
- /*
- * shared library init function. All shared libraries should have one. Its name is
- * declared in the .exp file.
- */
-
- // note: hinst is not needed for the 68k ODBCSharedLibraries functions
- }
-
- #endif // PPCODBC
-
- // _____________________________________________________________________________
- void
- SampleDriverObit()
- {
- /*
- * Shared library cleanup function. All shared libraries should have one. Its name is
- * declared in the .exp file.
- */
-
- #if PPCODBC
- DisposHandle( hinst );
- #endif // PPCODBC
- }
-
-